import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:yt_devops/components/app_bar/app_bar_widget.dart';
import 'package:yt_devops/components/brn/brn_bottom_button_panel.dart';
import 'package:yt_devops/components/gaps.dart';
import 'package:yt_devops/pages/mine/user_manage/mine_reset_password/views/user_change_pwd_textField.dart';
import 'package:yt_devops/resources/str_res_keys.dart';
import 'package:yt_devops/styles/styles.dart';
import 'mine_reset_password_controller.dart';

class MineResetPasswordPage extends GetView<MineResetPasswordController> {
    const MineResetPasswordPage({Key? key}) : super(key: key);

    @override
    Widget build(BuildContext context) {
    return  GetBuilder<MineResetPasswordController>(
        builder: (_) {

            return Scaffold(
                resizeToAvoidBottomInset: false,
                appBar: AppBarWidget.withRightActions(ResKey.mineUserManagerResetPwd.tr,),
                body: Column(
                    children: [
                        Gaps.vGap10,
                        pwdTextField(controller.pwdController, ResKey.pleEnterNewPassword.tr, (text) {
                            controller.textOnchange(text);
                        },isLeft: true,),
                        Container(
                            height: 1,
                            color: Colour.dividerColor,
                            margin: const EdgeInsets.only(left: 16,right: 16),
                        ),
                        pwdTextField(controller.againPwdController, ResKey.pleConfirmNewPassword.tr, (text) {
                            controller.textOnchange(text);
                        },isLeft: true,),
                        const Spacer(),
                        Align(
                            alignment: Alignment.bottomCenter,
                            child: Container(
                                color: Colors.white,
                                height: 82 + ScreenUtil().bottomBarHeight,
                                padding: EdgeInsets.only(bottom: ScreenUtil().bottomBarHeight),
                                child: YtBrnBottomButtonPanel(
                                    enableMainButton: controller.enableCommit,
                                    mainButtonName: ResKey.sure.tr,
                                    mainButtonOnTap: () => controller.save(),
                                    secondaryButtonName: ResKey.cancel.tr,
                                    enableSecondaryButton: true,
                                    secondaryButtonBorder:
                                    Border.all(color: Colour.dividerColor),
                                    secondaryButtonOnTap: () =>
                                        Get.back()),
                            ),
                            ),
                    ],
                ),
            );
        },
    );
    }
}
